package com.ciwong.epaper.modules.me.ui;

import android.content.Intent;
import android.net.Uri;
import android.view.View;

import com.ciwong.epaper.R;
import com.ciwong.epaper.application.EApplication;
import com.ciwong.mobilelib.i.GoBackListener;
import com.ciwong.mobilelib.i.ViewOnClickListener;
import com.ciwong.mobilelib.ui.BaseActivity;
import com.ciwong.mobilelib.utils.BaseJumpManager;

/**
 * Created by Administrator on 2016/9/13.
 */
public class SendParentBuyActivity extends BaseActivity {

    @Override
    protected int setView() {
        return R.layout.activity_send_parent_buy;
    }

    @Override
    protected void findViews() {

    }

    @Override
    protected void initEvent() {

        setGoBackListener(new GoBackListener() {
            @Override
            public void goBack() {
                onBackPressed();
            }
        });
    }

    @Override
    protected void init() {
        setTitleText("通知家长购买");
        setImgRightBtn(R.mipmap.nav_right_phone);
        setImgRightBtnListener(new ViewOnClickListener() {
            @Override
            public void avertRepeatOnClick(View v) {
                contactService();
            }
        });
    }

    @Override
    protected void loadData() {
    }


    @Override
    public void onBackPressed() {
        finish();
    }

    /**
     * 联系客服
     */
    private void contactService() {
        Intent intent = new Intent(Intent.ACTION_DIAL);
        Uri data = Uri.parse("tel:" + getString(R.string.service_phone));
        intent.setData(data);
        intent.putExtra(BaseJumpManager.INTENT_FLAG_SOURCE, true);
        startActivity(intent);
    }
}
